<template>
  <div>
    <component :is="h(ElInput, { ...$attrs, ...props, ref: changRef }, $slots)"></component>
  </div>
</template>

<script lang="ts" setup>
import { getCurrentInstance, h } from 'vue'
import { ElInput, type InputProps } from 'element-plus'

const props = defineProps<Partial<InputProps>>()
const vm = getCurrentInstance()
function changRef(el: any) {
  console.log(el)
  if (vm) {
    vm.exposed = el || {}
    vm.exposeProxy = el || {} // 更好的处理v-if的时候，避免报错
  }
}
</script>

<style></style>
